/* test_008 */

#include <stdio.h>
#include <stdlib.h>

void
hidden_func (void)
{
	register unsigned long long fast = 0;
	register long long unsigned normal = 0;

	printf("\n-- sleeping --\n");
	sleep(2);

	printf("fast == %llu \n",fast);
	for (fast = 0.0 ; fast < 1<<26 ; fast += 1.0) {}
	printf("fast == %llu \n", fast);
	//printf("Variable 'fast' is defined as `register long unsigned int fast = 0'\n");

	printf("\n-- sleeping --\n");
	sleep(2);

	printf("normal == %llu \n", normal);
	for (normal = 0.0 ; normal < 1<<26 ; normal += 1.0) {}
	printf("normal == %llu \n", normal);
	//printf("Variable 'normal' is defined as `long unsigned int normal = 0'\n");
}

int
main (int argc, char **argv)
{
	char ch;
	char *pstring = "111111111111111";
	char string[] = "2222222222222222";
	int i;
	short s;
	unsigned short us;
	unsigned int ui;
	long unsigned LU;
	char b[3];
	char* pchr;
	int* pint;

	ch='a';

	printf("sizeof() :\n\n");
	printf("\tchar 'ch' (%c) -- %lu\n", ch, sizeof(ch));
	printf("\tpointer to char 'pstring' (%p) -- %lu\n", pstring, sizeof(pstring));
	printf("\tstring '*pstring' (%s) -- %lu\n", pstring, sizeof(pstring));
	printf("\tstring 'string[]' (%s) -- %lu\n", string, sizeof(string));
	printf("\tint 'i' -- %lu\n", sizeof(i));
	printf("\tshort 's' -- %lu\n", sizeof(s));
	printf("\tunsigned short 'us' -- %lu\n", sizeof(us));
	printf("\tunsigned int 'ui' -- %lu\n", sizeof(ui));
	printf("\tlong unsigned 'LU' -- %lu\n", sizeof(LU));
	printf("\tsizeof(b + 0) given char b[3] -- %lu\n", sizeof(b + 0));
	printf("\tchar* 'pchr' -- %lu\n", sizeof(pchr));
	printf("\tint* 'pint' -- %lu\n", sizeof(pint));

	if (argc>1)
	{
		hidden_func ();
	}
	exit(0);
}
